package com.qhhc.service.impl;

import com.qhhc.entity.Role;
import com.qhhc.mapper.RoleMapper;
import com.qhhc.service.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class RoleService implements IRoleService {
    @Autowired
    private RoleMapper roleMapper;
    @Override
    public void insertRole(Role role) {
        roleMapper.insertRole(role);
    }

    @Override
    public void deleteRole(Role role) {
        roleMapper.deleteRole(role);
    }

    @Override
    public void updateRole(Role role) {
        roleMapper.updateRole(role);
    }

    @Override
    public Role getRoleById(long roleId) {
        Role role = roleMapper.selectRoleById(roleId);
        return role;
    }
    
    @Override
    public List<Role> getAllRoles() {
        return roleMapper.selectAllRoles();
    }
}
